package org.nfyszny.zzzs.modules.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.nfyszny.zzzs.modules.entity.ZzzsProductRecording;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @Description: 产品备案
 * @Author: jeecg-boot
 * @Date: 2022-11-11
 * @Version: V1.0
 */
public interface IZzzsProductRecordingService extends IService<ZzzsProductRecording> {
    /**
     * 获取产品列表数据
     *
     * @return
     */
    List<ZzzsProductRecording> getListInfo();

    /**
     * 产品备案
     *
     * @param zzzsProductRecording
     */

    void saveProductRecordInfo(ZzzsProductRecording zzzsProductRecording);

    /**
     * 根据公司id查询产品备案
     *
     * @param queryWrapper
     * @param page
     * @return
     */
    IPage<ZzzsProductRecording> getListByCompanyId(QueryWrapper<ZzzsProductRecording> queryWrapper, Page<ZzzsProductRecording> page);

    /**
     * 查询处于新建状态的产品备案列表
     *
     * @param queryWrapper
     * @param page
     * @return
     */
    IPage<ZzzsProductRecording> getCreateListByCompanyId(QueryWrapper<ZzzsProductRecording> queryWrapper, Page<ZzzsProductRecording> page);

    IPage<ZzzsProductRecording> getExitList(QueryWrapper<ZzzsProductRecording> queryWrapper, Page<ZzzsProductRecording> page);

    IPage<ZzzsProductRecording> getExitaLL(QueryWrapper<ZzzsProductRecording> queryWrapper, Page<ZzzsProductRecording> page);

    IPage<ZzzsProductRecording> getCanApply(QueryWrapper<ZzzsProductRecording> queryWrapper, Page<ZzzsProductRecording> page);

    void applyForExit(ZzzsProductRecording zzzsProductRecording);

    void yesExit(ZzzsProductRecording zzzsProductRecording);

    void noExit(ZzzsProductRecording zzzsProductRecording);

    /**
     * 提交备案信息
     *
     * @param zzzsProductRecording
     */
    void submitRecord(ZzzsProductRecording zzzsProductRecording);

    @Transactional
    void change(ZzzsProductRecording zzzsProductRecording);

    @Transactional
    void review(ZzzsProductRecording zzzsProductRecording);

    /**
     * 查询已备案完成的备案信息
     *
     * @param id
     * @return
     */
    ZzzsProductRecording getHaveInfoById(String id);

    /**
     * 追溯
     * @param productId
     * @return
     */
    Map<String, Object> traceSource(String productId);

    Map<String, Object> retroactiveAccountability(String productId);
}
